package com.xyzq.model.ya.report;

import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.appfuse.model.BaseObject;

import com.xyzq.model.ya.data.Account;

public class AccountDayAssert extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1465990605000373282L;

	private Account account;
	private Double cash;
	private Double fund;
	private Double stock;
	private Date valueDay;

	public Account getAccount() {
		return account;
	}

	public Double getCash() {
		return cash;
	}

	public Double getFund() {
		return fund;
	}

	public Double getStock() {
		return stock;
	}

	public Date getValueDay() {
		return valueDay;
	}

	public Double getSum() {
		return cash + fund + stock;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public void setCash(Double cash) {
		this.cash = cash;
	}

	public void setFund(Double fund) {
		this.fund = fund;
	}

	public void setStock(Double stock) {
		this.stock = stock;
	}

	public void setValueDay(Date valueDay) {
		this.valueDay = valueDay;
	}

	@Override
	public String toString() {
		ToStringBuilder builder = new ToStringBuilder(this);
		builder.append("account", account);
		builder.append("cash", cash);
		builder.append("fund", fund);
		builder.append("stock", stock);
		builder.append("valueDay", valueDay);
		return builder.toString();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AccountDayAssert other = (AccountDayAssert) obj;
		if (account == null) {
			if (other.account != null)
				return false;
		} else if (!account.equals(other.account))
			return false;
		if (cash == null) {
			if (other.cash != null)
				return false;
		} else if (!cash.equals(other.cash))
			return false;
		if (fund == null) {
			if (other.fund != null)
				return false;
		} else if (!fund.equals(other.fund))
			return false;
		if (stock == null) {
			if (other.stock != null)
				return false;
		} else if (!stock.equals(other.stock))
			return false;
		if (valueDay == null) {
			if (other.valueDay != null)
				return false;
		} else if (!valueDay.equals(other.valueDay))
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((account == null) ? 0 : account.hashCode());
		result = prime * result + ((cash == null) ? 0 : cash.hashCode());
		result = prime * result + ((fund == null) ? 0 : fund.hashCode());
		result = prime * result + ((stock == null) ? 0 : stock.hashCode());
		result = prime * result
				+ ((valueDay == null) ? 0 : valueDay.hashCode());
		return result;
	}

}
